﻿<phone:PhoneApplicationPage 
    x:Class="IndonesiaNews.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:local="clr-namespace:IndonesiaNews"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True" Name="mainPage" Loaded="mainPage_Loaded">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="INDONESIA NEWS" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="sinopsis" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ProgressBar Height="4" Name="downloadProgressBar" Margin="0,138,0,0" VerticalAlignment="Top" IsIndeterminate="True" /-->
        
        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ListBox Height="529" HorizontalAlignment="Left" Name="listBox1" VerticalAlignment="Top" Width="456" SelectionChanged="ArticleList_SelectionChanged"
                     toolkit:TiltEffect.IsTiltEnabled="True">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid ShowGridLines="False"><!-- visual debugging aid -->
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="140" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition MinHeight="48" />
                                <RowDefinition MinHeight="40" />
                            </Grid.RowDefinitions>
                            <TextBlock Text="{Binding Title}" MaxHeight="96" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource PhoneTextLargeStyle}" TextWrapping="Wrap" TextTrimming="WordEllipsis"
                                       Padding="0,0,0,36"/>
                            <Image Source="{Binding ThumbnailSource}" Grid.Column="0" Grid.Row="1" VerticalAlignment="Top" Margin="16,0,0,0"/>
                            <TextBlock Text="{Binding InfoText}" Grid.Column="1" Grid.Row="1" Style="{StaticResource PhoneTextSmallStyle}" 
                                       Margin="12,-4,0,0" VerticalAlignment="Top"/>
                            <TextBlock Text="{Binding Summary}" MaxHeight="100" Grid.Column="1" Grid.Row="1" VerticalAlignment="Top" Style="{StaticResource PhoneTextSmallStyle}" TextTrimming="WordEllipsis" TextWrapping="Wrap" 
                                       Margin="12,24,12,16"/>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
                <!--
                <local:Article>
                    <local:Article.Title>Yuhuu</local:Article.Title>
                    <local:Article.Summary>Keren bo</local:Article.Summary>
                </local:Article>
                <local:Article>
                    <local:Article.Title>Yuhuu</local:Article.Title>
                    <local:Article.Summary>Keren bo</local:Article.Summary>
                </local:Article>
                -->
            </ListBox>
        </Grid>
        <Image Height="161" Name="logoImage" Stretch="Uniform" Source="/IndonesiaNews;component/Images/visit-indonesia_outline_161p.png" Margin="0,0,12,0" HorizontalAlignment="Right" Width="181" />
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.refresh.rest.png" Text="segarkan" Click="Refresh_Click"/>
            <!--shell:ApplicationBarIconButton IconUri="/Images/appbar.questionmark.rest.png" Text="tentang" Click="About_Click"/-->
            <shell:ApplicationBar.MenuItems>
                <!--shell:ApplicationBarMenuItem Text="Fill listBox1" Click="FillListBox1_Click"/-->
                <!--shell:ApplicationBarMenuItem Text="download feed" Click="DownloadFeed_Click"/-->
                <shell:ApplicationBarMenuItem Text="tentang" Click="About_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

</phone:PhoneApplicationPage>